1. Field of the Invention
The present invention relates to a program specification generating system for generating specification data based on a source code of a program written in a variety of programming languages.
2. Description of the Related Art
Generally, a source code written in a programming language such as C++ includes comment statements which are not converted into an object code even if compiled. Normally, the comment statement includes an explanation abut processing of the program. Thus, when the comment statement is extracted from the source code, the explanation about processing of the program is obtained.
Therefore, a specification generating system for automatically generating a program specification by extracting the comment statements from the source code, has been utilized. This specification generating system incorporates, in addition to the function of generating the specification by extracting the comment statements from the source code, a function used for an operator to edit the generated specification, and a function of updating the comment statements in the source code based on the edited specification.
Normally, the source code includes a plurality of “aggregates.” For example, if the source code is written in C++, classes, member functions, external functions and exogenous variables correspond to the aggregates. Especially the function (the member function and the external function) among those aggregates, includes processing procedures, and is therefore referred to as a “aggregate having the processing procedures.”
The comment statements are classified into a first type of comment statement written immediately before the aggregate, and a second type of comment statement written in the processing procedure in the “aggregate having the processing procedure.” The conventional specification generating system automatically generates the specification by extracting the first type of comment statements from the source code. Then, an operator operates this specification generating system to edit the generated specification. To be specific, the operator inputs additional information and changes the description to correct the specification.
Further, this specification generating system updates the original source code based on the edited specification. That is, the specification generating system converts the content of the edited specification into the comment statement, and the converted statement(the first type of comment statement) is replaced with the previous statement disposed just before the aggregate corresponding thereto to update the source code.
The specification generating system according to the prior art explained above does not regard the second type of comment statement as a processing target. Supposing that the conventional specification generating system treats the second type of comment statement as the processing target, there arise the following problems. Namely, the problem is that even if the conventional specification generating system has generated the specification by extracting the first and second types of comment statements from the source code, change points by editing in the second type of comment statement can not be used to update the original source code. It is because the conventional specification generating system is incapable of recognizing the position in the “aggregate having the processing procedure” (that is, a function) at which the second type of comment statement converted from the content of the edited specification should be disposed.
It may be considered that the specification generating system inserts the second type of comment statement corresponding to the change point into the function with reference to an absolute position of a description line number etc in the source code to update the source code. In this case, however, the source code must not be changed at all during the period till the change points by editing in the specification is used to update this source code after the specification has automatically been generated. That is, the operator becomes unable to modify the source code during this period. Therefore, an efficiency of development declines.
Accordingly, the conventional specification generating system has dealt with only the first type of comment statement as the processing target. That is, the conventional system generates the specification by extracting only the first type of comment statements from the source code. The specification generated based on only the first type of comment statements, however, has insufficient contents in description.